package com.tang.campus_market.controller;



import com.tang.campus_market.entity.Comment;
import com.tang.campus_market.entity.Test;
import com.tang.campus_market.service.CommentService;
import com.tang.campus_market.service.TestService;
import com.tang.campus_market.util.Result;
import com.tang.campus_market.util.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/test")
@CrossOrigin //跨域
public class TestController {

    @Autowired
    private TestService testService;
    @Autowired
    private CommentService commentService;

    //根据id查询
    @RequestMapping(value = "{id}",method = RequestMethod.GET)
    public Result selectById(@PathVariable String id) {
        System.out.println("1111");
        Test test = testService.selectById(id);
        return new Result(StatusCode.OK, "查询成功", test);

    }

}